import java.util.Scanner;


public class test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] a = new int[11];
        for (int i=1;i<11;i++){
            a[i]=in.nextInt();
        }
        int n=in.nextInt();
        for (int i=0;i<n;i++){
            int m=in.nextInt();
            a[m]+=10;
        }
        int cut=0;
        for (int i=1;i<11;i++){
            if (cut==0){
                System.out.print(a[i]);
                cut++;
            }
            else {
                System.out.print(" "+a[i]);
            }
        }
    }
}
